package com.nwpu.coursesupport.view.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.nwpu.coursesupport.controller.AbstractController;
import com.nwpu.coursesupport.entity.bean.JSONResult;

@Controller
@RequestMapping("/taskPersonAssistantList")
public class TaskPersonalListAssistantViewController extends AbstractController{
	
	@RequestMapping("/listData")
	public String listData(@RequestParam("courseId")int id,Integer pageNo,HttpServletRequest request){
		pageNo=pageNo==null?1:pageNo;
		String data="{\"courseId\":\"" + id + "\",\"pageNo\":\""+pageNo+"\"}";
		JSONResult rst=invokeService("taskPersonalListAssistantView", "listViewData", data);
		request.setAttribute("data", this.parseData(rst));
		return "/teapage/courseAssistantTask";
	}
	
	@RequestMapping("/ajaxListData")
	@ResponseBody
	public JSONResult ajaxListData(@RequestParam("data")String data){
		JSONResult rst=invokeService("taskPersonalListAssistantView", "listViewData", data);
		return rst;
	}
}
